<template>
  <a-locale-provider :locale="locale">
    <div id="app">
      <router-view />
    </div>
  </a-locale-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device'
import '../src/components/texiao/abc'
import axios from 'axios'
let protocol = window.location.protocol //协议
let host = window.location.host //主机
let reg = /^localhost+/

if (reg.test(host)) {
  //若本地项目调试使用
  axios.defaults.baseURL = '172.16.1.29:8080/zkxh-emr/zkxh/demo/'
} else {
  //动态请求地址
  axios.defaults.baseURL = protocol + '//' + host + '/api/'
}

axios.defaults.timeout = 30000

export default {
  name: 'app',
  axios, //这里记得导出，若请求地址永久固定一个，则就按照`普通版`配置一个baserURL就可以了
  data() {
    return {
      locale: zhCN
    }
  },
  created() {
    let that = this
    enquireScreen(deviceType => {
      // tablet
      if (deviceType === 0) {
        that.$store.commit('TOGGLE_DEVICE', 'mobile')
        that.$store.dispatch('setSidebar', false)
      }
      // mobile
      else if (deviceType === 1) {
        that.$store.commit('TOGGLE_DEVICE', 'mobile')
        that.$store.dispatch('setSidebar', false)
      } else {
        that.$store.commit('TOGGLE_DEVICE', 'desktop')
        that.$store.dispatch('setSidebar', true)
      }
    })
  }
}
</script>
<style>
#app {
  height: 100%;
}
/deep/ .ant-menu-item-selected {
  color: cyan;
}
.ant-tabs-ink-bar,.ant-tabs-ink-bar-animated{
  border-bottom: 6px solid #38c3c8 !important;
}
.ant-tabs-nav,.ant-tabs-nav-animated::after{
  border-bottom: 6px solid #38c3c8 !important;
}
.ant-menu-submenu-title span:hover{
color: #38c3c8 !important;
}
.ant-modal-body {
  padding: 0px !important;
  border-radius: 4px !important;
}
</style>